###
 # @Date: 2020-10-27 19:13:07
 # @LastEditors: Tonser
 # @LastEditTime: 2020-11-02 20:30:09
 # @FilePath: /swarm_ws/src/px4_gcs/scripts/start.sh
 # @Description: start 启动脚本 使用前需要执行config.sh
### 
#!/bin/bash

# 运行mavros
PASSWD="up"

#把以下配置内容填入到.bashrc中
#ID=0
#USB_COM=1

echo $PASSWD | sudo -S chmod 777 /dev/ttyUSB*

roslaunch mavros px4.launch fcu_url:=$MAVROS_USB_COM:921600 &

# 运行hgj 覆盖程序
sleep 5
roslaunch px4_gcs HGJ_coverage_drone$SWARM_ID.launch &

# 运行collect—image 保存图片
sleep 5
rosrun collect_image collect_image_node &

# mainclient 运行pm 通信程序
sleep 5
# rosrun px4_gcs mainclient.py &

# record 记录这个topic
sleep 5
rosbag record /collect_image/image /mavros/local_position/pose /mavros/global_position/global /mavros/ready /swarm/state
